package kingpengcom.demoopengl.demoopengl;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import kingpengcom.demoopengl.demoopengl.hello_world.HelloWorldAty;

public class MainActivity extends AppCompatActivity {

    Class[] clzzes = new Class[] {
        HelloWorldAty.class
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        LinearLayout lyContainer = findViewById(R.id.ly_container);
        Button button;
        for (final Class clzz : clzzes) {
            button = new Button(this);
            button.setText(clzz.getSimpleName());
            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    startActivity(new Intent(MainActivity.this, clzz));
                }
            });
            lyContainer.addView(button);
        }
    }
}
